<?php
if(!isset($_SESSION)) 
	{ 
		session_start(); 
	}
function getlang(){
		$lang = $_SESSION['lang'];
		if (empty($lang) || $lang == "EN") {
			$value = "../value/value_en.php";
		} else if($lang == "VN") {
			$value = "../value/value_vn.php";
		}
		else {
			$value = "../value/value_kr.php";
		}
		return $value;
	}
$value = getlang();
include($value);
if(isset($_GET['check'])){
 	$_SESSION['check']=$_GET['check'];
}
$check=$_SESSION['check'];

$listapprove=$_SESSION['listapprove'];
$listapprovename=$_SESSION['listapprovename'];


	foreach ($listapprove as $approve=>$abc){
		$mangone=array();
		foreach ($abc as $hienthi){
			if($hienthi[0]!=$_GET['q']){
				$mangone[]=array($hienthi[0],$hienthi[1]);
			}
		}
		$list[$approve]=$mangone;
		
	}

$listapprove=$list;
	

echo "<table width='100%' class='templ' cellspacing='0'>
            <tr class='titapp titapp2'>
                               	  <td></td>
                                	<td>$l_order</td>
                                	<td><div align='center'><img src='images/approve.png' alt='' width='12px' style='float:left; border:1px solid #eee' />$l_approver</div></td>
                                	<td><div align='center'><img src='images/reference.png' alt='' width='12px' style='float:left; border:1px solid #eee' />$l_reference</div></td>
                           	  </tr>";
$i=1;
foreach ($listapprove as $approve=>$abc){
	echo "                         <tr>";
    if($check==$i){
                               echo "<td><input type='radio' name='ra_app' value='".$i."' onclick='handler(this.value)' checked='checked'/></td>";
    }else{
    	echo "<td><input type='radio' name='ra_app' value='".$i."' onclick='handler(this.value)'/></td>";
    }
       echo                          " <td>".$i."</td>";
    
       echo"                           <td>".$listapprovename[$approve]."</td>";
        echo"                          <td>";
                                  foreach ($abc as $hienthi){
                                  		
                                  		echo"<div><a onclick='delReference(".$hienthi[0].")'><img src='images/del.png' alt='' width='10px' style='border:1px solid #eee; margin-right:10px' /></a>".$hienthi[1]."</div>";
                                  }             
                                  echo"</td>";
       echo                    "   </tr>";
                              
                              $i++;
}                              
                              
echo "                         <tr class='titapp titapp22'>
                               	  <td colspan='4'><div align='center'>
                               	    <input type='button' value='Delete' onclick='delApprove()' class='btnupbg btnupload' />
                           	      </div></td>
                           	  </tr>
                          </table>";

	$_SESSION['listapprove']=$listapprove;
?>